﻿
<!DOCTYPE html>
<html>
<head>
    <title>企捷云</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_1468812105_88105.css">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/animate.css">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/bootstrap3.3.5/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/default.css">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/index.css">
    <link href="/ViewV5/CSS/BootOver.css" rel="stylesheet" />
    <style>
        .ms-controller, .ms-important, [ms-controller], [ms-important] {
            visibility: hidden;
        }

        .szhl_getPeoples {
            display: none;
        }
    </style>
</head>
<body ms-controller="GZBGUserLIST">
    <div class="pt20">
        <!-- 按条件选择 -->
        <div class="tab-filter-type">
            <div class="oh">
                <h5 class="pull-left tr">报告类型：</h5>
                <ul class="tab-type ft14">
                    <li ms-click="SelectXJType('')"><span ms-class-1="active:curXJType==''">全部</span></li>
                    <li ms-repeat-el="TypeData" ms-click="SelectXJType(el.ID)"><span ms-class-1="active:el.ID==curXJType">{{el.TypeName}}</span></li>
                </ul>
            </div>

            <!-- 搜索 -->
            <div class="oh">
                <h5 class="pull-left tr">自定义搜索：</h5>
                <div class="input-group ml15" style="width: 395px; float: left;">
                    <input type="search" class="form-control" ms-duplex="searchcontent" placeholder="报告内容" style="height: 30px">
                </div>
                <span class="btn btn-success" ms-click="GetLIST()" style="float: left; height: 30px;width:100px">搜索</span>

            </div>
        </div>
        <!-- 展开更多选项 -->
        <div class="add-tab ft14 tc mt20" style="display: none;">
            <span>更多筛选<i class="caret"></i></span>
        </div>
        <!-- 表格 -->
        <div class="default-tab ft14 pt20">
            <table class="table table-striped table-responsive table-hover">
                <thead>
                    <tr>
                        <th class="tc width-70">
                            序号
                        </th>

                        <th>类型</th>
                        <th>创建人</th>
                        <th>部门</th>
                        <th>日期</th>
                        <th>报告内容</th>
                        <th style="width: 80px;"></th>
                    </tr>
                </thead>
                <tbody>
                    <tr ms-repeat-el="ListData">
                        <td class="tc">
                            {{$index+1}}
                        </td>

                        <td>{{el.TypeName}}</td>
                        <td>{{el.CRUserName}}</td>
                        <td>{{el.BranchName}}</td>
                        <td>{{el.RBDate|date("yyyy-MM-dd")}}</td>
                        <td>{{fnFormat(el.RBContent)|html}}<span ms-if="el.Files"><i class="iconfont icon-fj ft14 ml5"></i></span></td>
                        <td>
                            <a class="cz-btn ft18 bj-color tip" data-toggle="tooltip" title="查看" ms-click="OpenView(el.ID,el.intProcessStanceid,$event)">
                                <i class="iconfont icon-look"></i>
                            </a>
                        </td>
                    </tr>

                </tbody>
                <tfoot>
                    <tr ms-if="isnull">
                        <td class="tc"></td>
                        <td>暂无数据</td>
                    </tr>
                </tfoot>
            </table>

        </div>
    </div>

    <script type="text/javascript" src="/ViewV5/JS/jquery-1.11.2.min.js"></script>
    <script src="/ViewV5/CSS/bootstrap3.3.5/js/bootstrap.js"></script>
    <script src="/ViewV5/JS/layer/layer.js"></script>
    <script src="/ViewV5/JS/layer/extend/layer.ext.js"></script>
    <script src="/ViewV5/JS/laypage/laypage.js"></script>
    <script src="/ViewV5/JS/toastr.js"></script>
    <script src="/ViewV5/JS/avalon1.47.js"></script>
    <script src="/ViewV5/JS/SZHLCommon.js?jsver=20160915"></script>
    <script>

        var tempindex = avalon.define({
            $id: "GZBGUserLIST",
            curXJType: "",
            month: ComFunJS.getQueryString("month"),
            user: ComFunJS.getQueryString("username"),
            searchcontent: "",
            ListData: [],
            TypeData: [],
            isnull: true,
            SelectXJType: function (type) {
                tempindex.curXJType = type;
                tempindex.GetLIST();

            },
            fnFormat: function (str) {
                str = ComFunJS.convstr(str);
                str = str.length > 40 ? str.substring(0, 40) + '...' : str;
                return str;
            },
            GetTypeData: function () {//P1:字典类别，callback:回调函数,p2:字典类别ID
                $.getJSON('/API/VIEWAPI.ashx?Action=XTGL_GETZIDIANSLIST', { P1: 6 }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        tempindex.TypeData = resultData.Result;
                    }
                })
            }, 

            GetLIST: function () { 
                tempindex.ListData.clear();
                $.getJSON('/API/VIEWAPI.ashx?Action=GZBG_GETGZBGUSERLIST',
                    {
                        P2: tempindex.searchcontent, P1: tempindex.curXJType, month: tempindex.month, username: tempindex.user
                    }, function (resultData) {
                        if (resultData.ErrorMsg == "") {
                            tempindex.ListData = resultData.Result;
                            if (tempindex.ListData.size() == 0) { tempindex.isnull = true; } else { tempindex.isnull = false; }
                        }
                    })
            },
            OpenView: function (ID, PIID, event) {
                location.href = "/ViewV5/AppPage/APPVIEW.html?FormCode=GZBG_GZBG&ID=" + ID + "&PIID=" + PIID + "&isback=Y&r=" + Math.random();
            },
        })
        avalon.ready(function () {

            //类型数据
            tempindex.GetTypeData();
            tempindex.GetLIST();
            ComFunJS.initForm();
        })
        //@ sourceURL=GZBGUserLIST.js;
    </script>
</body>


</html>